Andrew Lord ReverseMeNot 2.1 Feb 1999 *********** ******** ******** 0. PREAMBLE Unfortunately, you have to read all of this file to get the most out of RevMeNot if you have multi-module applications OR use the OPL @(): syntax. If you don't then you *may* be able to get away without reading it (Except for the Conditions of Use!!) 1.INTRODUCTION ReverseMeNot helps to protect your translated OPL modules from being convered back to the original OPL source code. This could allow people to defeat copy protection schemes or "borrow" your code without permission. It is possible to convert .OPO files back into their original .OPL text (well, almost). Parameter names, local variable names and comments will be lost but everything else is stored in a compact form within the .OPO or .OPA file. A program called RevTran is capable of converting this compact tokenised form back into the original OPL (almost). RevTran is really just a tool and should not be thought of as a "naughty" program. However, there are occasions when you do not want people to view or alter your original OPL source code. It is possible to stop Revtran 4.2 working by confusing it. This can be done by inserting garbage information in the OPO or OPA file. This is how ReversemeNot works. It is also possible to replace the meaningful global variable and procedure names with simple, shorter, less obvious names. This has three benefits: 1) Resultant .OPO or .OPA is physically smaller 2) Less memory requirements when running 3) If the code is reverse translated (eg by RevTran) then no useful information could be obtained from inspection of variable or procedure names. Because ReverseMeNot operated directly on the OPO it has the following additional advantages: 4) it can use names that are not legal OPL (eg names containing punctuation) so any OPL code derived from it will fail to translate. 5) OPO has a different name space for each variable TYPE so it is possible for an integer, a long and a real variable to all have EXACTLY the same name within the OPO file. This is prohibited in OPL and therefore creates a many to one mapping between variable names in the .OPA and the original .OPL. This not only defeats translation but makes it impossible to derive the original meaning of a protected module that has been reverse translated without additional proceesing to remove the protection prior to reverse translation. For example the program text, PROC main: local i%,f,s$(10),l& i%=f ENDP after compression, may reverse translate to PROC !: local !,!,!(10),! !=! ENDP from the generated OPL text it is *impossible* to derive the original meaning of the program. 2. CONCEPTS ReverseMeNot has two distinct protection methods, Disable and Compress. 2.1 Disable The "Disable" optionsimply prevents RevTran from reverse translating a module. It does *not* perform the variable name confusion mentioned above. ReverseMeNot protects every procedure in a module to that Revtran 4.2 is unable to decode it. You do not need to make any changes to your original OPL source code. 2.2 Compress The "Compress" replaces variable names with more unusual confusing names. It does *not* prevent revere-translation (see "Disable") but it will prevent re-translation of opl obtained using revtran. The basic "disable" option can easily be circumvented by a determined individual. ITS IS STRONGLY RECOMMENDED THAT YOU USE IT IN CONJUNCTION WITH THE COMPRESS OPTION TO SIGNIFICANTLY INCREASE PROTECTION. 2.2.1 Compress - Map files ReverseMeNot has an option to to store, in a file, the mapping between the original procedure or variable name and the new shorter one. These mappings can then be reused when performing subsequent conversions on related OPL modules. This ensures that for a given procedure (or variable) the assigned compressed name is the same even if you reorder the procedures in the OPL file. These mappings are stored in files with the extension '.MAP'. If you select the "Compress" option you will be asked for input and output maps. If you are translating a stand alone module or a group of modules that form a *complete* single application you can generally do without maps and select "none". If you are compressing a library module alone then you should set an *output* map file. This could be later used as the input map to other applications that use the library and saves you having to re-compress the library. 2.2.2 The Default Map file By default the input and output map files are assumed to be the same file. This file is in the same directory and has the same name as the input *OPO* or *OPA* file - but with the extension .MAP. 2.2.3 Renaming related Modules When processing a suite of modules that comprise a single application you should specify a single .MAP file as both input and output. In this way the mappings used to process each module will be preserved for the processing of subsequent modules. NOTE: In this case you should NOT use the default map setting, because this map is different for each module. 2.2.4 Stable libraries You may have a large library, or suite of libraries, that are quite static. Whenever you want to process a program against these libraries you can either re-process all of the modules required by your application or you can create a map file for the stable libraries alone. Then you can just re-process the changed files using the library .MAP file as input. 2.3 Exclude files and the '@(""):' syntax In OPL it is possible to issue dynamic calls to procedures, using the @(""): syntax. In this case the name of the called procedure is generated by your program at runtime. If your program uses this syntax you must make sure that any procedures called in this way are not compressed by ReverseMeNot. This is accomplished using exclude files. These are simple plain text files created using either the OPL editor or the Text only mode of the Word application. The format is simply a list of the names of the global variables and/or procedures that must not be changed. These files can also include other exclude files using the include syntax eg: ----- MYAPP.EXC ------ #include "MYLIB1.EXC" #include "GRAPHLIB.EXC" PROC xyz: PROC choose1% ----------------------- In this case the variable names "Garray%" and "Gcount%" will be preserved as well as the procedure name "xyz:" and "choose1%:". Note the mandatory trailing colon after procedure names. It is assumed that you will include files that contain names that must be preserved in any underlying libraries require by your application. NOTE: This is only necessary if you use the @:() syntax. Procedures that are not called using this method do not need to be added to the exclude file even if the call is across modules. You simply have to ensure that both modles are translated using the same mappings. If you compress a module that uses @("name"): and also has unreferenced prodecures ReverseMeNot will advise you which procedures it thinks you should add to an exclude file. This advice is not absolute and you should really inspect the code to fully determine which procedures should be preserved. NOTE: If you use an exclude file and generate an output map - the procedures will be flagged as excluded within the map. If the map is subsequently used as an input map, so it is not necessary to re-specifiy the exclude file. For this reason the ability for one exclude file to #include another is slightly superflous. 2.3.1 Excluding Global Variables You should not really have to add global variable names to this file but I have included it for completeness. One reason for preventing renaming of global varaibles is if your application will reference an unprotected module that also uses the global variable. ----- MYAPP.EXC ------ #include "MYLIB1.EXC" #include "GRAPHLIB.EXC" Garray% Gcount% PROC xyz: PROC choose1%: ----------------------- In this case the variable names "Garray%" and "Gcount%" will be preserved as well as the procedure names "xyz:" and "choose1%:". 2.3.2 The Default Exclude file By default the exclude file is assumed to be in the same directory and have the same name as the input *OPO* or *OPA* file - but with the extension .EXC. 3. REQUIRED HARDWARE ReverseMeNot 2.1 runs on a 3a,3c,3mx and the Siena. (it does not run on the original series 3) 4. RESOURCES ReverseMeNot 2.1 uses 20K of disk space and requires varying amounts of memory according to the complexity of the procedures being compressed. (generally about 30K) 5. INSTALLATION Unzip the .OPO files and transfer to the /APP directory. 6. FREQUENTLY ASKED QUESTIONS None Yet ! 7. HISTORY 18/2/99 ReverseMeNot 2.1 o Some bug fixes. 19/10/98 ReverseMeNot 2.0 o Compression/obsfucation o Sienna compatible dialogs? ReverseMeNot 1.0 ---------------- o Protection from Revtran 4.2 ############################################################################# Legal Bit ********* "This software" refers to ReverseMeNot. You have a permission to use this software on the grounds that you accept that I cannot be held liable for any loss or damage, of any kind, that may occur as a result of using this sotware, eiher directly or indirectly. There is no warranty, expressed or implied, regarding the use or merchantability of this software. (C) 1998 Andrew Lord This file is copyright Andrew Lord, it may be freely copied provided o The complete copyright section is incorporated including these conditions unmodified o All changes to the body of the file are clearly marked and attributed o The file is not supplied in any collection or via any distribution mechanism without the written consent of the copyright holder. ******** Manifest ******** This release contains five files revmenot.txt This file revmenot.opa The Pason application for series 3a/3c/Sienna **************** Acknowledgements **************** Mike Rudin RevTran Author,opo.fmt co-writer David Palmer AKA Author - AKA is the original PC hosted OPL Compressor/Obsfucator. Author ****** Suggestions for improvements should be directed to me: Andrew Lord lordy@bigfoot.com